
package edu.tongji.jiaowu.dao.jdbc;
 
import java.util.List;

import edu.tongji.jiaowu.dao.TaskCourseDao;
import com.tongji.quickCRUDQ.define.Row;
import com.tongji.quickCRUDQ.model.CommonBean;
import com.tongji.quickCRUDQ.dao.jdbc.BaseDaoJdbc;

public class TaskCourseDaoJdbc extends BaseDaoJdbc implements TaskCourseDao {
	String tableName="T_TASK_COURSE";
	String beanName="taskCourse";
	
	public CommonBean createTaskCourse(){
		CommonBean taskCourses=this.createBean(tableName,beanName);
                return taskCourses;		
	}
	
/*
	public CommonBean findTaskCourses(String refid) {
		CommonBean taskCourses=this.createTaskCourse();
		String sql="select * from T_TASK_COURSE where refid=?";
		List data=this.getCommonDao().select(sql,new String[]{refid});
		taskCourses.addData(data);
                return taskCourses;
       }
*/
	public CommonBean findTaskCourseById(String id) {
		CommonBean taskCourses=this.createTaskCourse();
		String sql="select * from T_TASK_COURSE where id=?";
		List data=this.getCommonDao().select(sql,new String[]{id});
		taskCourses.addData(data);
    return taskCourses;
  }
  
	public CommonBean findAllTaskCourses() {
		CommonBean taskCourses=this.createTaskCourse();
		String sql="select * from T_TASK_COURSE ";
		List data=this.getCommonDao().select(sql,new String[]{});
		taskCourses.addData(data);
    return taskCourses;
  }
	public void insertTaskCourse(CommonBean taskCourseBean){
		List data=taskCourseBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchInsert(row,data,this.getIdGenerator());
	}
}

